// --------------------------------------------------------------------------------------------------------------------
// <copyright file="HeartbeatModel.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Hardware.EV4.Visualization
{
    using Microsoft.Robotics.Visualization;

    /// <summary>
    /// The HeartbeatModel that provides content for the view
    /// </summary>
    public class HeartbeatModel : Model
    {
        /// <summary>
        /// Gets or sets the Time stamp in 10s of milli-seconds
        /// </summary>
        public long TimeStamp { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 1 reading
        /// </summary>
        public double Prox1InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 2 reading
        /// </summary>
        public double Prox2InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 3 reading
        /// </summary>
        public double Prox3InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 4 reading
        /// </summary>
        public double Prox4InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 5 reading
        /// </summary>
        public int Prox5InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 6 reading
        /// </summary>
        public double Prox6InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 7 reading
        /// </summary>
        public double Prox7InMm { get; set; }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 8 reading
        /// </summary>
        public double Prox8InMm { get; set; }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 1 reading
        /// </summary>
        public double Cliff1InMm { get; set; }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 2 reading
        /// </summary>
        public double Cliff2InMm { get; set; }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 3 reading
        /// </summary>
        public double Cliff3InMm { get; set; }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 4 reading
        /// </summary>
        public double Cliff4InMm { get; set; }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 5 reading
        /// </summary>
        public double Cliff5InMm { get; set; }

        /// <summary>
        /// Gets or sets the Carry sensor, 1 = carry, 0 = no carry
        /// </summary>
        public byte CarryDetected { get; set; }

        /// <summary>
        /// Gets or sets the Internal temperature reading in 10ths of degrees C
        /// </summary>
        public double TemperatureInternalIn10ThsCelsius { get; set; }

        /// <summary>
        /// Gets or sets the Projector temperature (Red) reading in degrees C
        /// </summary>
        public double TemperatureProjectorRedInCelsius { get; set; }

        /// <summary>
        /// Gets or sets the Projector temperature (Green) reading in degrees C
        /// </summary>
        public double TemperatureProjectorGreenInCelsius { get; set; }

        /// <summary>
        /// Gets or sets the Projector temperature (Blue) reading in degrees C
        /// </summary>
        public double TemperatureProjectorBlueInCelsius { get; set; }

        /// <summary>
        /// Gets or sets the External temperature reading in 10ths of degrees C
        /// </summary>
        public double TemperatureExternalIn10ThsCelsius { get; set; }

        /// <summary>
        /// Gets or sets the External relative humidity
        /// </summary>
        public double RelativeHumidityInPercent { get; set; }

        /// <summary>
        /// Gets or sets the Battery voltage
        /// </summary>
        public double BatteryVoltageInmV { get; set; }

        /// <summary>
        /// Gets or sets the Battery current
        /// </summary>
        public double BatteryCurrentInmA { get; set; }

        /// <summary>
        /// Gets or sets the Battery temperature
        /// </summary>
        public double BatteryTemperatureIn10ThsCelcius { get; set; }

        /// <summary>
        /// Gets or sets the Battery charge state
        /// </summary>
        public double BatteryChargeInPercent { get; set; }

        /// <summary>
        /// Gets or sets the Battery average time to empty
        /// </summary>
        public double BatteryAvgTimeToEmptyInMinutes { get; set; }

        /// <summary>
        /// Gets or sets the Battery status
        /// </summary>
        public int BatteryStatus { get; set; }

        /// <summary>
        /// Gets or sets the 5V rail voltage 
        /// </summary>
        public double Power5VInmV { get; set; }

        /// <summary>
        /// Gets or sets the 12V rail voltage 
        /// </summary>
        public double Power12VInmV { get; set; }

        /// <summary>
        /// Gets or sets the Accelerometer reading in gravities 
        /// </summary>
        public double AccelForwardInG { get; set; }

        /// <summary>
        /// Gets or sets the Accelerometer reading in gravities
        /// </summary>
        public double AccelRightInG { get; set; }

        /// <summary>
        /// Gets or sets the Accelerometer reading in gravities
        /// </summary>
        public double AccelUpInG { get; set; }

        /// <summary>
        /// Gets or sets the Gyro x-axis
        /// </summary>
        public double GyroXInRadiansPerSecond { get; set; }

        /// <summary>
        /// Gets or sets the Gyro y-axis
        /// </summary>
        public double GyroYInRadiansPerSecond { get; set; }

        /// <summary>
        /// Gets or sets the Gyro z-axis
        /// </summary>
        public double GyroZInRadiansPerSecond { get; set; }

        /// <summary>
        /// Gets or sets the Left motor position
        /// </summary>
        public double MotorLeftPositionInMm { get; set; }

        /// <summary>
        /// Gets or sets the Right motor position
        /// </summary>
        public double MotorRightPositionInMm { get; set; }

        /// <summary>
        /// Gets or sets the Left motor velocity
        /// </summary>
        public double MotorLeftVelocityInMperSec { get; set; }

        /// <summary>
        /// Gets or sets the Right motor velocity
        /// </summary>
        public double MotorRightVelocityInMperSec { get; set; }

        /// <summary>
        /// Gets or sets the Left motor acceleration
        /// </summary>
        public double MotorLeftAccelerationInMperSec2 { get; set; }

        /// <summary>
        /// Gets or sets the Right motor acceleration
        /// </summary>
        public double MotorRightAccelerationInMperSec2 { get; set; }

        /// <summary>
        /// Gets or sets the state of various peripherals (on/off) using enum PowerStates
        /// </summary>
        public PowerStates PowerStates { get; set; }

        /// <summary>
        /// Gets or sets the state of various binary sensors using enum DriveSensorStates
        /// </summary>
        public DriveSensorStates SensorStates { get; set; }

        /// <summary>
        /// Gets or sets the Projector heading in radians 
        /// </summary>
        public double ProjectorHeadingInRadians { get; set; }

        /// <summary>
        /// Gets or sets the Projector vertical inversion
        /// </summary>
        /// <remarks>
        ///     bit 0 set == vertical inversion
        ///     bit 1 set == horizontal inversion
        /// </remarks>
        public byte ProjectorInversion { get; set; }

        /// <summary>
        /// Gets or sets the Projector brightness
        /// </summary>
        public int ProjectorBrightness { get; set; }

        /// <summary>
        /// Gets or sets the Projector focus position in steps
        /// </summary>
        public short ProjectorFocusPositionInSteps { get; set; }

        /// <summary>
        /// Gets or sets the Projector idle
        /// </summary>
        public byte ProjectorIdle { get; set; }

        /// <summary>
        /// Gets or sets the Camera heading in radians 
        /// </summary>
        public double CameraHeadingInRadians { get; set; }

        /// <summary>
        /// Gets or sets the Turret heading in radians
        /// </summary>
        public double TurretHeadingInRadians { get; set; }

        /// <summary>
        /// Gets or sets the Turret velocity in milli radians per sec.
        /// </summary>
        public double TurretVelocityInMiliRadsPerSec { get; set; }

        /// <summary>
        /// Gets or sets the Left sonar reading in millimeters
        /// </summary>
        public double SonarDistanceLeftInMillimeters { get; set; }

        /// <summary>
        /// Gets or sets the Right sonar reading in millimeters
        /// </summary>
        public double SonarDistanceRightInMillimeters { get; set; }

        /// <summary>
        /// Gets or sets the Current setting of cooling fan
        /// </summary>
        public double FanPower0To1 { get; set; }

        /// <summary>
        /// Gets or sets the Speed of left cooling fan
        /// </summary>
        public double LeftFanRpm { get; set; }

        /// <summary>
        /// Gets or sets the Speed of right cooling fan
        /// </summary>
        public double RightFanRpm { get; set; }

        /// <summary>
        /// Gets or sets the Bit field used to determine which cliff sensor detected a cliff
        /// </summary>
        public CliffSensorStates CliffState { get; set; }

        /// <summary>
        /// Gets or sets the State of each servo controlled by the drive controller
        /// </summary>
        public int ServoStates { get; set; }

        /// <summary>
        /// Gets or sets the Left Wheel ready for next sequence
        /// </summary>
        public byte LeftWheelReadyForNextSequence { get; set; }

        /// <summary>
        /// Gets or sets the Right Wheel ready for next sequence
        /// </summary>
        public byte RightWheelReadyForNextSequence { get; set; }

        /// <summary>
        /// Gets or sets the Turret ready for next sequence
        /// </summary>
        public byte TurretReadyForNextSequence { get; set; }

        /// <summary>
        /// Gets or sets actual left drive speed in (meters/second)
        /// </summary>
        public double ActualLeftDriveSpeedInMetersPerSecond { get; set; }

        /// <summary>
        /// Gets or sets actual right drive speed in (meters/second)
        /// </summary>
        public double ActualRightDriveSpeedInMetersPerSecond { get; set; }

        /// <summary>
        /// Gets or sets current position of the right wheel
        /// </summary>
        public double RightWheelPositionInMeters { get; set; }

        /// <summary>
        /// Gets or sets current position of the left wheel
        /// </summary>
        public double LeftWheelPositionInMeters { get; set; }

        /// <summary>
        /// Gets or sets estimated odometric orientation of drive (range of 0 to 2pi).
        /// </summary>
        public double DriveHeadingEstimateInRadians { get; set; }

        /// <summary>
        /// Gets or sets absolute estimated odometric orientation of drive.
        /// Angle is not corrected to be within a specific range.
        /// </summary>
        public double AbsoluteDriveHeadingEstimateInRadians { get; set; }

        /// <summary>
        /// Gets or sets estimated odometric orientation of drive.
        /// </summary>
        public double DrivePositionZEstimateInMeters { get; set; }

        /// <summary>
        /// Gets or sets estimated odometric orientation of drive.
        /// </summary>
        public double DrivePositionXEstimateInMeters { get; set; }
    }
}
